﻿using RabbitMQ.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RabbitMQ_Common
{
    public class RabbitMQHelper
    {
        public static IConnection GetConnection()
        {
            var factory = new ConnectionFactory {
                HostName = "119.29.92.184",//地址
                Port = 5672,//端口
                UserName = "admin",//账号
                Password = "xianrunwei",//密码
                VirtualHost = "/"//虚拟主机
            };
            return factory.CreateConnection();

        }
    }
}
